import request from '@/utils/request'
// 添加
export function addRoles(data) {
  return request({
    url: '/sys/role',
    method: 'post',
    data
  })
}
// 获取全部
export function getRoles(params) {
  return request({
    url: '/sys/role',
    method: 'get',
    params
  })
}
// 修改
export function updateRoles(data) {
  return request({
    url: `/sys/role/${data.id}`,
    method: 'put',
    data
  })
}
// 删除
export function delRoles(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'delete'

  })
}
// 获取单个详细
export function getRolesDetail(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'get'

  })
}

export function putAssignPrem(data) {
  return request({
    url: '/sys/role/assignPrem',
    method: 'put',
    data
  })
}
